from frontend.roleApplication import RoleApplication
from frontend.form import Type
from vars import *

class GenericStarterRoleApplication(RoleApplication):

    def __init__(self):
        super(GenericStarterRoleApplication, self).__init__(WorkflowName, "ThisRoleName")
        # Here we use SOURCE step.  This means this role will be used to begin our workflow
        self.register_source_step("ThisStepName", self.generic_starter_role_form_creator)

    def generic_starter_role_form_creator(self, stepname, form):
        form.add_static_label('This is a static label! Use it as a header and section separator!')
        form.add_field(Type.SHORTSTRING, "SampleText", labeltext="Sample Text Field", initial="This is the default value!")
        form.add_field(Type.BOOLEAN, 'SampleYesNo',labeltext="Sample Yes/No Field", initial=False)

if __name__ == '__main__':
    app = GenericStarterRoleApplication()
    app.MainLoop()